<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>代码编写Scriptlet</title>
</head>
<body>
<%  // 与HTML代码的区分主要依靠此标记
    out.println("<table border='1'>"); // 输出HTML元素
    for (int x = 1; x <= 9; x++) {   // 外层循环
        out.println("<tr>"); // 输出表格行
        for (int y = 1; y <= x; y++) { // 输出表格列
            out.println("<td>" + x + " * " + y + " = " + (x * y) + "</td>");
        }
        for (int y = 0; y < 9 - x; y++) {
            out.println("<td>&nbsp;</td>");
        }
        out.println("</tr>"); // 输出表格行
    }
    out.println("</table>");
%>

<%  // 与HTML代码的区分主要依靠此标记
    String message = "yootk";
    switch (message) {
        case "yootk":
            out.println("<h1>www.yootk.com</h1>");
            break;
        case "muyan":
            out.println("<h1>沐言科技</h1>");
        case "happy":
            out.println("<h1>爆可爱的小李老师</h1>");
    }
%>

<%  // 与HTML代码的区分主要依靠此标记
    StringBuffer buf = new StringBuffer();
    buf.append("www").append(".").append("yootk.com"); // 字符串连接
    out.println("<h1>" + buf + "</h1>");
%>
</body>
</html>
